<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;

use Illuminate\Database\Eloquent\Model;

class Article extends Model
{
    use HasDateTimeFormatter;

    public function articleType()
    {
        return $this->belongsTo(ArticleType::class,"type","id");
    }


    public function scopeWithOrder($query,$order){
        return $query->orderBy($order,"desc");
    }
}
